
#ifndef FIBER_ENV_FIBER_H_
#define FIBER_ENV_FIBER_H_

namespace fasmio { namespace fiber_env {

class Fiber
{
protected:
    virtual ~Fiber() {};

public:
    // To join the fiber.  The fiber object is deleted upon Join returns.
    virtual int Join() = 0;

//    // To wait for the fiber to quit.  The fiber object is still valid after
//    // Wait returns.
//    virtual bool Wait() = 0;

    // To get the name of the fiber
    virtual const char* GetName() = 0;

    // To get the unique id of the fiber
    virtual unsigned int GetID() = 0;

    // Set the fiber as a daemon fiber.  A daemon fiber will be automatically
    // Join'ed when it quitted.  Note that the Fiber object may be deleted
    // upon SetDaemon returns.
    virtual void SetDaemon() = 0;
};

}}  // namespace fasmio::fiber_env

#endif  // FIBER_ENV_FIBER_H_

